<template>
	<view>
		<u-navbar leftIconColor="#000000" :titleStyle="{ color: '#000000' }" :bgColor="bgColor" title="修改个人信息"
			:placeholder="true" :autoBack="true"></u-navbar>
		<view class="note">

		</view>
		<view class="" style="width: 92%;margin: 0 auto;padding-top: 15px;position: relative;z-index: 1;">
			<view class="" style="padding-bottom: 15px;">
				<text style="font-size: 15px;font-weight: 400;color: #333333;">账户安全</text>
			</view>
			<view style="padding: 0px 15px; background-color: #fff; border-radius: 10px">

				<view class="flex"
					style="justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #f3f3f3">
					<view style="color: #1d1f20; font-size: 14px; font-weight: 400">用户名</view>
					<view class="flex">
						<view style="font-size: 14px; color: #1d1f20; margin-right: 13px">{{ info.username }}</view>
						<u-icon style="visibility: hidden" name="arrow-right" color="#1D1F20" size="18"></u-icon>
					</view>
				</view>
				<view class="flex"
					style="justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #f3f3f3">
					<view style="color: #1d1f20; font-size: 14px; font-weight: 400">手机号</view>
					<view class="flex">
						<view style="margin-right: 13px; font-size: 14px; color: #1d1f20">{{ info.mobile }}</view>
						<u-icon style="visibility: hidden" name="arrow-right" color="#1D1F20" size="18"></u-icon>
					</view>
				</view>
				<view class="flex" @click="resetting" style="justify-content: space-between; padding: 15px 0">
					<view style="color: #1d1f20; font-size: 14px; font-weight: 400">密码</view>
					<view class="flex">
						<view style="margin-right: 13px; font-size: 14px; color: #1d1f20">修改密码</view>
						<u-icon name="arrow-right" color="#1D1F20" size="18"></u-icon>
					</view>
				</view>
			</view>
			<view class="" style="padding-bottom: 15px; margin-top: 32px">
				<text style="font-size: 15px;font-weight: 400;color: #333333;">账户安全</text>
			</view>
			<view style="padding: 0px 15px; background-color: #fff; border-radius: 10px;">
				<view @click="shiming" class="flex"
					style="justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #f3f3f3">
					<view style="color: #1d1f20; font-size: 14px; font-weight: 400">实名认证</view>
					<view class="flex">
						<view style="font-size: 14px; color: #FF3030; margin-right: 13px">{{ info.authentication_text }}
						</view>
						<u-icon style="" name="arrow-right" color="#1D1F20" size="18"></u-icon>
					</view>
				</view>
				<view @click="bang" class="flex"
					style="justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #f3f3f3">
					<view style="color: #1d1f20; font-size: 14px; font-weight: 400">绑定收款账户</view>
					<view class="flex">
						<view style="margin-right: 13px; font-size: 14px; color: #FF3030">
							{{ info.is_payment == 0 ? '未绑定' : '已绑定' }}
						</view>
						<u-icon style="" name="arrow-right" color="#1D1F20" size="18"></u-icon>
					</view>
				</view>
				<view @click="wx" class="flex" style="justify-content: space-between; padding: 15px 0">
					<view style="color: #1d1f20; font-size: 14px; font-weight: 400">微信号</view>
					<view class="flex">
						<view style="margin-right: 13px; font-size: 14px; color: #1d1f20">
							{{ info.wxnum != '' ? info.wxnum : '未填写' }}
						</view>
						<u-icon name="arrow-right" color="#1D1F20" size="18"></u-icon>
					</view>
				</view>
			</view>
		</view>
		<!-- <view style="padding: 0px 15px; background-color: #fff; border-radius: 10px; margin-top: 15px">
			<view @click="wx" class="flex" style="justify-content: space-between; padding: 15px 0">
				<view style="color: #1d1f20; font-size: 14px; font-weight: 400">微信二维码</view>
				<view class="flex">
					<view style="font-size: 14px; color: #1d1f20; margin-right: 13px">更新二维码</view>
					<u-icon style="" name="arrow-right" color="#1D1F20" size="18"></u-icon>
				</view>
			</view>
			<view class="flex" style="padding: 15px 0; justify-content: center">
				<image v-if="info.wxqrcode != ''" style="width: 186px" :src="imageurl + info.wxqrcode" mode="widthFix"></image>
				<view v-else style="width: 186px; text-align: center; line-height: 186px">暂未上传</view>
			</view>
		</view> -->
	</view>
</template>

<script>
	import config from '../../common/config/index.js';
	export default {
		data() {
			return {
				info: '',
				imageurl: config.imgurl,
				bgColor: 'rgba(255,255,255,0)',
			};
		},
		onPageScroll(e) {
			if (e.scrollTop > 50) {
				this.bgColor = 'rgba(255,255,255,1)'
			} else {
				this.bgColor = 'rgba(255,255,255,0)'
			}
		},
		onShow() {
			this.showUserInfo();
		},
		methods: {
			async showUserInfo() {
				let res = await this.$http.index.showUserInfo({});
				if (res.code == 1) {
					this.info = res.data;
					console.log(this.info);
				}
			},
			//实名
			shiming() {
				uni.navigateTo({
					url: '/pages/me/real_name',
				});
			},
			//绑定
			bang() {
				uni.navigateTo({
					url: '/pages/me/withdrawal',
				});
			},
			//重置密码
			resetting() {
				uni.navigateTo({
					url: '/pages/me/resetting?phone=' + this.info.mobile,
				});
			},
			//微信资料
			wx() {
				uni.navigateTo({
					url: '/pages/me/wx_information',
				});
			},
		},
	};
</script>
<style scoped lang="scss">
	/deep/ .u-button--primary {
		background-color: #ff3331;
		border-color: #ff3331;
	}

	.note {
		background-image: url('@/static/font/21.png');
		position: fixed;
		width: 100%;
		height: 100%;
		top: 0;
		background-size: 100% 100%;
	}

	/deep/ .u-icon__icon {
		line-height: normal !important;
	}
</style>
<style>
	page {
		background-color: #f7f9fa;
	}
</style>